#include "ChangeSheetCommand.h"
#include "FrakOutController.h"

ChangeSheetCommand::ChangeSheetCommand(const QString& text, FrakOutController& controller,
                         int lastSheetIndex, int nextSheetIndex) :
QUndoCommand(text), m_controller(controller), m_lastSheetIndex(lastSheetIndex),
m_nextSheetIndex(nextSheetIndex)
{
}

void ChangeSheetCommand::undo()
{
    m_controller.setCurrentSheet(m_lastSheetIndex);
}

void ChangeSheetCommand::redo()
{
    m_controller.setCurrentSheet(m_nextSheetIndex);
}
